home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / tip / graphmac.tip < prev    next >
Text File  |  1993-09-15  |  2KB  |  83 lines

  1. % This macro source file is from the four volume series
  2. % "TeX in Practice" by Stephan von Bechtolsheim, published
  3. % 1993 by Springer-Verlag, New York.
  4. % Copyright 1993 Stephan von Bechtolsheim.
  5. % No warranty or liability is assumed.
  6. % This macro may be copied freely if no fees other than
  7. % media cost or shipping charges are charged and as long
  8. % as this copyright and the following source code itself
  9. % is not changed. Please see the series for further information.
  10. %
  11. % Version: 1.0
  12. % Date: May 1, 1993
  13. %
  14. %
  15. % This source code is documented in 9.2.1, p. I-314.
  16. % Original source in file "boxit.TEX", starting line 79.
  17. \wlog{L: "graphmac.tip" ["boxit.TEX," l. 79, p. I-314]}%
  18. % This file DOES belong to format "texip."
  19. \InputD{box-zero.tip}
  20. \catcode`\@ = 11
  21. \newdimen\@ScaleLength
  22. \def\SetScale #1{% 
  23.     \@ScaleLength = #1
  24. }
  25. \SetScale{1mm}
  26. \newdimen\@LineThickness
  27. \def\SetLineThickness #1{%
  28.     \@LineThickness = #1
  29. }
  30. \SetLineThickness{0.3mm}
  31. \newbox\@GraphDataBox
  32. \def\SetGraphDataBox #1{%
  33.     \dimen0 = #1%
  34.     \setbox\@GraphDataBox =
  35.         \hbox{%
  36.             \hskip -0.5\dimen0
  37.             \vrule height 0.5\dimen0
  38.                    depth  0.5\dimen0
  39.                    width  1.0\dimen0
  40.         }%
  41.     \ZeroBox{\@GraphDataBox}%
  42. }
  43. \SetGraphDataBox{2mm}
  44. \def\DrawDataBox (#1,#2){%
  45.     {%
  46.         \setbox0 = \hbox{%
  47.             \hskip #1\@ScaleLength
  48.             \raise #2\@ScaleLength\copy\@GraphDataBox
  49.         }%
  50.         \ZeroBoxOut{0}% 
  51.     }% 
  52. }
  53. \def\DrawHLine (#1,#2)#3{%
  54.     {%
  55.         \setbox0 = \hbox{%
  56.             \hskip #1\@ScaleLength
  57.             \raise #2\@ScaleLength
  58.                 \hbox{%
  59.                     \vrule height 0.5\@LineThickness
  60.                            depth  0.5\@LineThickness
  61.                            width  #3\@ScaleLength
  62.                 }% 
  63.         }%
  64.         \ZeroBoxOut{0}% 
  65.     }% 
  66. }
  67. \def\DrawVLine (#1,#2)#3{%
  68.     {%
  69.         \setbox0 = \hbox{%
  70.             \hskip #1\@ScaleLength
  71.             \hskip -0.5\@LineThickness
  72.             \raise #2\@ScaleLength
  73.                 \hbox{%
  74.                     \vrule height #3\@ScaleLength
  75.                            depth  0pt
  76.                            width  \@LineThickness
  77.                 }% 
  78.         }%
  79.         \ZeroBoxOut{0}% 
  80.     }% 
  81. }
  82. \catcode`\@ = 12
  83.